import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TPetLifestyleHunt } from "../../../Message/Db/Tables/TPetLifestyleHunt";
type int = number;
//class PetLifeStyleHuntConfig
    
    export  class PetLifeStyleHuntConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (PetLifeStyleHuntConfig._instance != null) 
            {
                throw new Error(" PetLifeStyleHuntConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_pet_lifestyle_hunt.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TPetLifestyleHunt();
                loc1.gold = loc2.gold;
                loc1.goldCostNextRate = loc2.goldCostNextRate;
                loc1.goldReward = loc2.goldReward;
                loc1.hunterName = loc2.hunterName;
                loc1.itemCost = loc2.itemCost;
                loc1.itemCostNextRate = loc2.itemCostNextRate;
                loc1.itemReward = loc2.itemReward;
                loc1.level = loc2.level;
                this._map[loc1.level] = loc1;
            }
            return;
        }

        public getPetLifeStyleHuntByLevel(arg1: int): TPetLifestyleHunt
        {
            return this._map[arg1];
        }

        public static get instance(): PetLifeStyleHuntConfig
        {
            if (PetLifeStyleHuntConfig._instance == null) 
            {
                PetLifeStyleHuntConfig._instance = new PetLifeStyleHuntConfig();
            }
            return PetLifeStyleHuntConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: PetLifeStyleHuntConfig;
    }
